package com.bsj.sipgateway.common.constant;


import com.bsj.sipgateway.util.CommandDownType;

/**
 * 定义常量
 */
public class Constants {

	// 设备在线
	public static final int DEVICE_ONLINE = 1;

	// 设备离线
	public static final int DEVICE_OFFLINE = 0;


	//实时视频
	public static final String PLAYER_PREFIX = "0";

	//历史视频
	public static final String PLAY_BLACK_PREFIX = "1";

	//对讲-语音广播
	public static final String BROADCAST_PREFIX = "2";

	//注册
	public static final String EVENT_ONLINE_REGISTER = "1";

	//保持在线
	public static final String EVENT_ONLINE_KEEPLIVE = "2";

	//注销
	public static final String EVENT_OUTLINE_UNREGISTER = "1";

	//超时离线
	public static final String EVENT_OUTLINE_TIMEOUT = "2";

	//新增
	public static final String SQL_INSERT = "INSERT";

	//更新
	public static final String SQL_UPDATE = "UPDATE";


	public static Integer toMqCmdType(String constant){
		switch (constant){
			case PLAYER_PREFIX:
				return CommandDownType.REAL_MEDIA_CTRL_CLOSEALL;
			case PLAY_BLACK_PREFIX:
				return CommandDownType.DEV_VOD_MEDIA_CLOSE;
			case BROADCAST_PREFIX:
				return CommandDownType.REAL_MEDIA_CTRL_CLOSEINTERCOM;
			default:
				return -1;
		}
	}
}
